<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .outer {
        width: 400px;
        height: 30px;
        background-color: #000;
        border-radius: 15px;
        position: relative;
        border: 4px solid #000;
      }
      .inner {
        position: absolute;
        left: 0;
        top: 0;
        height: 30px;
        border-radius: 15px;
        /* width: 50%; */
        background-color: blue;
        transition: all 0.5s;
      }
    </style>
  </head>
  <body>
    <!-- 1. 先准备一个容器 -->
    <div id="app">
      <div class="outer">
        <div class="inner" v-bind:style="{width:w}"></div>
      </div>
      <button @click="w='25%'">25%</button>
      <button @click="w='50%'">50%</button>
      <button @click="w='75%'">75%</button>
      <button @click="w='100%'">100%</button>
    </div>
    <!-- 2. 引框架 -->
    <script src="./vue.js"></script>
    <script>
      //    表单 -> v-model
      //    样式 -> v-bind:class v-bind:style
      //    事件 -> v-on
      //    属性 -> v-bind
      //   数据响应式 只要操作数据就可以 因为数据变了 视图就跟着变
      // 3.初始化vue实例对象
      const vm = new Vue({
        el: "#app",
        data: {
          w: "25%",
        },
      });
    </script>
  </body>
</html>
